<!--
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-05-24 15:13:54
 * @LastEditors: 商晓彬
 * @LastEditTime: 2021-11-10 17:03:48
-->
<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #bopForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{title}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body" >
                    <div class="form-group" style="display: flex;">
                        <label for="model" style="margin-top: 7px;margin-right: 20px;width: 61.39px;">型号 *</label>
                        <p-dropdown filter="true" dataKey="value" [optionLabel]="'label'" required name="model" #modelInput="ngModel"
                        [options]="modelList" [(ngModel)]="model" placeholder="请选择" emptyFilterMessage="暂无数据" (onChange)="onChange($event)">
                        </p-dropdown>
                        <!-- <input id="model" #modelInput="ngModel" type="text" name="model" class="form-control"
                            [(ngModel)]="form.model" required maxlength="256" /> -->
                        <validation-messages [formCtrl]="modelInput"></validation-messages>
                        <label for="lotNo" style="margin-top: 7px;margin-right: 20px;margin-left: 100px;width: 87.39px;">发次 *</label>
                        <p-dropdown filter="true" dataKey="value" [optionLabel]="'label'" required name="lotNo" #lotNoInput="ngModel"
                        [options]="lotNoList" [(ngModel)]="lotNo" placeholder="请选择" emptyFilterMessage="暂无数据" (onChange)="getName($event)">
                        </p-dropdown>
                        <!-- <input id="lotNo" #lotNoInput="ngModel" type="text" name="lotNo" class="form-control"
                            [(ngModel)]="form.lotNo" required maxlength="256" /> -->
                        <validation-messages [formCtrl]="lotNoInput"></validation-messages>
                    </div>
                    <div class="form-group" style="display: flex;">
                        <label for="modelName" style="margin-top: 7px;margin-right: 20px;width: 61.39px;">名称 *</label>
                        <input id="modelName" style=" width:200px;height: 35px;" #modelNameInput="ngModel" type="text" name="modelName"
                            class="form-control" [(ngModel)]="form.modelName" required maxlength="256" />
                        <validation-messages [formCtrl]="modelNameInput"></validation-messages>
                        <label for="drawingNo" style="margin-top: 7px;margin-right: 20px;margin-left: 100px;width: 87.39px;">图号 *</label>
                        <input id="drawingNo" style=" width:200px;height: 35px;" #drawingNoInput="ngModel" type="text" name="drawingNo"
                            class="form-control" [(ngModel)]="form.drawingNo" required maxlength="256" />
                        <validation-messages [formCtrl]="drawingNoInput"></validation-messages>
                    </div>
                    <div class="form-group" style="display: flex;">
                        <label for="stageSign" style="margin-top: 7px;margin-right: 20px;">阶段标记 *</label>
                        <input id="stageSign" #stageSignInput="ngModel" type="text" name="stageSign"
                            class="form-control" style=" width:200px;height: 35px;" [(ngModel)]="form.stageSign" required maxlength="256" />
                        <validation-messages [formCtrl]="stageSignInput"></validation-messages>
                        <label for="stageSign" style="margin-top: 7px;margin-right: 20px;margin-left: 100px;">工时维护位置 *</label>
                        <p-dropdown required name="repairPart" #workingHourStatusSelect="ngModel"
                            [options]="workingHourOption" [(ngModel)]="form.workingHourStatus">
                            <ng-template let-select pTemplate="selectedItem">
                                <span
                                    style="vertical-align:middle; margin-left: .5em;width:175px;">{{select.label}}</span>
                            </ng-template>
                            <ng-template let-select pTemplate="select">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px;width: 175px; ">
                                        {{select.label}}
                                    </div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                        <validation-messages [formCtrl]="workingHourStatusSelect"></validation-messages>
                    </div>
                    <div class="form-group" style="display: flex;">
                       
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">取消</button>
                    <button type="submit" class="btn btn-primary" [disabled]="!bopForm.form.valid" [buttonBusy]="saving"
                        [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i> <span>保存</span></button>
                </div>
            </form>
        </div>
    </div>
</div>